// pages/mine/com-process/com-process.js
import { formatDateTime } from "../../../../utils/util";
Component({
  options: {
    styleIsolation: 'apply-shared',
    addGlobalClass: true,
  },
  
  /**
   * 组件的属性列表
   */
  properties: {
    model: {
      type: Array,
      default: []
    }
  },

      //监听组件数据
      observers: {
        model(){
          let model = [...this.data.model]
          
          for(var i in model){
            model[i].time = formatDateTime(model[i].pullNewTime|| model[i].couponEndTime||model[i].useCouponTime||model[i].time, true)
            model[i].type = model[i].type.toLowerCase()
          }
          this.setData({
            _model: model
          })
        }
      },

  /**
   * 组件的初始数据
   */
  data: {
    _model:[]
  },

  /**
   * 组件的方法列表
   */
  methods: {

  }
})
